<?php
/**
 * Created by PhpStorm.
 * User: evan.wan
 * Date: 2015/8/7
 * Time: 16:02
 */
namespace Common\Controller;

use Think\Auth;
use Think\Controller;

class AuthController extends Controller{
    protected function _initialize() {
        $sess_auth = session('auth');
        if(!$sess_auth)
        {
            $this->error('没有登陆用户！', U('Login/index'));
        }
        //管理员 不认证
        if($sess_auth['uid'] == 1){
            return true;
        }



        $auth = new Auth();
        if(!$auth->check()){
            $this->error('权限验证失败！', U('Login/index'));
        }

    }

}